<div class="container top">

      <ul class="breadcrumb">
        <li>
          <a href="<?php echo site_url("admin"); ?>">
            <?php echo ucfirst($this->uri->segment(1));?>
          </a> 
          <span class="divider">/</span>
        </li>
        <li class="active">
          <?php echo ucfirst($this->uri->segment(2));?>
        </li>
      </ul>

      <div class="page-header users-header">
        <h2>
          <?php echo ucfirst($this->uri->segment(2));?> 
          <a  href="<?php echo site_url("admin").'/'.$this->uri->segment(2); ?>/add" class="btn btn-success">Add a new</a>
        </h2>
      </div>
      
      <div class="row">
        <div class="span12 columns">
          <div class="well">
           
            <?php
           
            $attributes = array('class' => 'form-inline reset-margin', 'id' => 'myform');
            $options_group_id=array();
            $options_group_id["Science"]="Science";
            $options_group_id["Humanities"]="Humanities";
            $options_group_id["Business Studies"]="Business Studies";
            
            $options_academic_session =array();
            
            $academic_session=$_SESSION['academic_session'];
            foreach($academic_session as $row)
            {
            	$options_academic_session[$row["academic_session"]]=$row["academic_session"];

            }

            //save the columns names in a array that we will use as filter         
            $options_students = array();    
            $options_students['student_id'] = "Roll";
            $options_students ['student_name'] = "Name";
            $options_students ['dob'] = "DOB";
            $options_students ['remarks'] = "Remarks";
            

             echo form_open('admin/student', $attributes);
     
              echo form_label('Search:', 'search_string');
              echo form_input('search_string', $search_string_selected, 'style="width: 120px;
height: 26px;"');

              echo form_label('session:', 'academic_session');
              echo form_dropdown('academic_session', $options_academic_session, $academic_session_selected, 'style="width: 100px;"');
              
              echo form_label('Group:', 'group');
              echo form_dropdown('group_id', $options_group_id, $group_id_selected, 'style="width: 100px;"');

              echo form_label('Order by:', 'order');
              echo form_dropdown('order', $options_students, $order, 'style="width: 80px;"');

              $data_submit = array('name' => 'mysubmit', 'class' => 'btn btn-primary', 'value' => 'Go');

              $options_order_type = array('Asc' => 'Asc', 'Desc' => 'Desc');
              echo form_dropdown('order_type', $options_order_type, $order_type_selected, 'class="span1"');
              echo form_label('&nbsp;', '');

              echo form_submit($data_submit);

            echo form_close();
            ?>

          </div>

          <table class="globaltable globaltable-striped globaltable-bordered globaltable-condensed">
            <thead>
              <tr>
                <th class="header">#</th>
                <th class="yellow header headerSortDown">Roll No</th>
                <th class="green header">Name</th>
                <th class="red header">Feather's Name</th>
                <th class="red header">Mother's Name</th>
                <th class="red header">DOB</th>
                <th class="red header">Group</th>
                <th class="red header">Remarks</th>
                
              </tr>
            </thead>
            <tbody>
            <?php
             $ind=1;
             foreach($students as $row)
              {
                echo '<tr>'; 
                echo '<td>'.$ind++.'</td>';
                echo '<td>'.$row['student_id'].'</td>';
                echo '<td>'.$row['student_name'].'</td>';
                echo '<td>'.$row['fathername'].'</td>';
                echo '<td>'.$row['mothername'].'</td>';
                echo '<td>'.$row['dob'].'</td>';
                echo '<td>'.$row['group_id'].'</td>';
                echo '<td>'.$row['remarks'].'</td>';
                
                echo '</tr>';
              }
              ?>      
            </tbody>
          </table>

          <?php echo '<div class="pagination">'.$this->pagination->create_links().'</div>'; ?>

      </div>
    </div>